﻿@page "/dialogs"
@inject IStringLocalizer<Dialogs> Localizer

<h3>@Localizer["Title"]</h3>
<h4>@((MarkupString)Localizer["Description"].Value)</h4>

<p>@Localizer["Tip1"]：</p>

<p class="code-label">@((MarkupString)Localizer["Tip2"].Value) </p>
<Pre>@@inject DialogService DialogService</Pre>
<Pre>[Inject]
[NotNull]
private DialogService? DialogService { get; set; }
</Pre>
<p class="code-label">@((MarkupString)Localizer["Tip3"].Value)</p>
<Pre>var op = new DialogOption()
{
    Title = @Localizer["DialogTitle"],
    ShowFooter = false,
    BodyContext = DataPrimaryId
};
op.Component = BootstrapDynamicComponent.CreateComponent&lt;DataDialogComponent&gt;(new Dictionary&lt;string, object?&gt;
{
    [nameof(DataDialogComponent.OnClose)] = new Action(async () => await op.OnCloseAsync())
});
await DialogService.Show(op);</Pre>
<p class="code-label">@((MarkupString)Localizer["Tip4"].Value)</p>
<Pre>[CascadingParameter]
private Func&lt;Task&gt;? OnCloseAsync { get; set; }

private async Task OnClick()
{
    if (OnCloseAsync != null)
    {
        await OnCloseAsync();
    }
}
</Pre>
<p class="code-label">@((MarkupString)Localizer["Tip5"].Value)</p>
<Pre>&lt;DialogCloseButton /&gt;</Pre>

<DemoBlock Title="@Localizer["KeyboardTitle"]" Introduction="@Localizer["KeyboardIntro"]" Name="Keyboard" Demo="typeof(Demos.Dialog.DialogKeyboard)">
    <p>@((MarkupString)Localizer["KeyboardTip"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["CustomerHeaderTitle"]" Introduction="@Localizer["CustomerHeaderIntro"]" Name="CustomerHeader" Demo="typeof(Demos.Dialog.DialogCustomerHeader)" />

<DemoBlock Title="@Localizer["HeaderToolbarTemplateTitle"]" Introduction="@Localizer["HeaderToolbarTemplateIntro"]" Name="HeaderToolbarTemplate" Demo="typeof(Demos.Dialog.DialogHeaderToolbarTemplate)" />

<DemoBlock Title="@Localizer["ComponentTitle"]" Introduction="@Localizer["ComponentIntro"]" Name="Component" Demo="typeof(Demos.Dialog.DialogComponent)">
    <div class="mb-2">@((MarkupString)Localizer["ComponentTip"].Value)</div>
</DemoBlock>

<DemoBlock Title="@Localizer["BodyContextTitle"]" Introduction="@Localizer["BodyContextIntro"]" Name="BodyContext" Demo="typeof(Demos.Dialog.DialogBodyContext)">
    <p>@((MarkupString)Localizer["BodyContextTip"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["ApplyTitle"]" Introduction="@Localizer["ApplyIntro"]" Name="Apply" Demo="typeof(Demos.Dialog.DialogApply)" />

<DemoBlock Title="@Localizer["CloseDialogByCodeTitle"]" Introduction="@Localizer["CloseDialogByCodeIntro"]" Name="CloseDialogByCode" Demo="typeof(Demos.Dialog.DialogCloseDialogByCode)">
    <div class="mb-2">@((MarkupString)Localizer["CloseDialogByCodeTip"].Value)</div>
</DemoBlock>

<DemoBlock Title="@Localizer["DisableHeaderCloseButtonTitle"]" Introduction="@Localizer["DisableHeaderCloseButtonIntro"]" Name="DisableHeaderCloseButton" Demo="typeof(Demos.Dialog.DialogDisableHeaderCloseButton)">
    <p>@((MarkupString)Localizer["DisableHeaderCloseButtonTip"].Value)</p>
</DemoBlock>

<DemoBlock Title="@Localizer["MultipleDialogTitle"]" Introduction="@Localizer["MultipleDialogIntro"]" Name="MultipleDialog" Demo="typeof(Demos.Dialog.DialogMultipleDialog)">
    <div class="mb-2">@Localizer["MultipleDialogTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@Localizer["MultipleDialogTip2"]</li>
        <li>@((MarkupString)Localizer["MultipleDialogTip3"].Value)</li>
        <li>@Localizer["MultipleDialogTip4"]</li>
        <li>@((MarkupString)Localizer["MultipleDialogTip5"].Value)</li>
    </ul>
    <div class="mb-2">@((MarkupString)Localizer["MultipleDialogDesc"].Value)</div>
</DemoBlock>

<DemoBlock Title="@Localizer["ModalDialogTitle"]" Introduction="@Localizer["ModalDialogIntro"]" Name="ModalDialog" Demo="typeof(Demos.Dialog.DialogModalDialog)">
    <div class="mb-2">@Localizer["ModalDialogTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@Localizer["ModalDialogTip2"]</li>
        <li>@((MarkupString)Localizer["ModalDialogTip3"].Value)</li>
        <li>@((MarkupString)Localizer["ModalDialogTip4"].Value)</li>
        <li>@Localizer["ModalDialogTip5"]</li>
    </ul>
</DemoBlock>

<DemoBlock Title="@Localizer["EditDialogTitle"]" Introduction="@Localizer["EditDialogIntro"]" Name="EditDialog" Demo="typeof(Demos.Dialog.DialogEditDialog)">
    <div class="mb-2">@Localizer["EditDialogTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@Localizer["EditDialogTip2"]</li>
        <li>@((MarkupString)Localizer["EditDialogTip3"].Value)</li>
        <li>@((MarkupString)Localizer["EditDialogTip4"].Value)</li>
    </ul>
</DemoBlock>

<DemoBlock Title="@Localizer["SearchDialogTitle"]" Introduction="@Localizer["SearchDialogIntro"]" Name="SearchDialog" Demo="typeof(Demos.Dialog.DialogSearchDialog)">
    <div class="mb-2">@Localizer["SearchDialogTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@Localizer["SearchDialogTip2"]</li>
        <li>@((MarkupString)Localizer["SearchDialogTip3"].Value)</li>
        <li>@((MarkupString)Localizer["SearchDialogTip4"].Value)</li>
    </ul>
</DemoBlock>

<DemoBlock Title="@Localizer["SaveDialogTitle"]" Introduction="@Localizer["SaveDialogIntro"]" Name="SaveDialog" Demo="typeof(Demos.Dialog.DialogSaveDialog)">
    <div class="mb-2">@Localizer["SaveDialogTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@Localizer["SaveDialogTip2"]</li>
        <li>@((MarkupString)Localizer["SaveDialogTip3"].Value)</li>
    </ul>
</DemoBlock>

<DemoBlock Title="@Localizer["SizeTitle"]" Introduction="@Localizer["SizeIntro"]" Name="Size" Demo="typeof(Demos.Dialog.DialogSize)" />

<DemoBlock Title="@Localizer["PrintDialogTitle"]" Introduction="@Localizer["PrintDialogIntro"]" Name="PrintDialog" Demo="typeof(Demos.Dialog.DialogPrintDialog)">
    <div class="mb-2">@((MarkupString)Localizer["PrintDialogTip"].Value)</div>
</DemoBlock>

<DemoBlock Title="@Localizer["ShowMaximizeButtonTitle"]" Introduction="@Localizer["ShowMaximizeButtonIntro"]" Name="ShowMaximizeButton" Demo="typeof(Demos.Dialog.DialogShowMaximizeButton)" />

<DemoBlock Title="@Localizer["ErrorLoggerTitle"]" Introduction="@Localizer["ErrorLoggerIntro"]" Name="ErrorLogger" Demo="typeof(Demos.Dialog.DialogErrorLogger)" />

<DemoBlock Title="@Localizer["EmailTitle"]" Introduction="@Localizer["EmailIntro"]" Name="Email" Demo="typeof(Demos.Dialog.DialogEmail)">
    <div class="mb-2">@Localizer["EmailTip1"]</div>
    <ul class="ul-demo mb-2">
        <li>@((MarkupString)Localizer["EmailTip2"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip3"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip4"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip5"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip6"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip7"].Value)</li>
        <li>@((MarkupString)Localizer["EmailTip8"].Value)</li>
    </ul>
    <label class="form-label">@Localizer["EmailLabel"]：</label>
</DemoBlock>

<AttributeTable Items="@GetAttributes()" Title="@Localizer["Attribute"]" />
